package com.erpanderp.wam.adm.model.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Transient;

public class Service {
	private Long serviceId;
	private String serviceName;
	private String displayName;
	private Date createDate;
	private Date dateModified;
	private String createdBy;
	private String modifiedBy;
	private String description;
	private String status;
	private String startPage;
	private Module module;	
	private ServiceGroup serviceGroup;	
	private Set<RoleService> roleServices = new HashSet<RoleService>();
	private Set<ServiceResource> serviceResources =new HashSet<ServiceResource>();
	
	private boolean assigned, checked;

	public Long getServiceId() {
		return serviceId;
	}
	public void setServiceId(Long serviceId) {
		this.serviceId = serviceId;
	}
	public String getServiceName() {
		return serviceName;
	}
	public void setServiceName(String serviceName) {
		this.serviceName = serviceName;
	}
	public String getDisplayName() {
		return displayName;
	}
	public void setDisplayName(String displayName) {
		this.displayName = displayName;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Date getDateModified() {
		return dateModified;
	}
	public void setDateModified(Date dateModified) {
		this.dateModified = dateModified;
	}
	public String getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	public String getModifiedBy() {
		return modifiedBy;
	}
	public void setModifiedBy(String modifiedBy) {
		this.modifiedBy = modifiedBy;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getStartPage() {
		return startPage;
	}
	public void setStartPage(String startPage) {
		this.startPage = startPage;
	}
	
	public ServiceGroup getServiceGroup() {
		return serviceGroup;
	}
	public void setServiceGroup(ServiceGroup serviceGroup) {
		this.serviceGroup = serviceGroup;
	}
	public Set<RoleService> getRoleServices() {
		return roleServices;
	}
	public void setRoleServices(Set<RoleService> roleServices) {
		this.roleServices = roleServices;
	}
	public Set<ServiceResource> getServiceResources() {
		return serviceResources;
	}
	public void setServiceResources(Set<ServiceResource> serviceResources) {
		this.serviceResources = serviceResources;
	}
	public Module getModule() {
		return module;
	}
	public void setModule(Module module) {
		this.module = module;
	}
	
	@Transient
	public boolean isAssigned() {
		return assigned;
	}
	public void setAssigned(boolean assigned) {
		this.assigned = assigned;
	}
	
	public boolean equals(Object obj){
		if(this == obj){
			return true;
		}	
		if(this.getServiceId().equals(((Service)obj).getServiceId())){
			return true;
		}
		return false;
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}

}
